package com.furniture.ui.utils;

import android.util.Log;

import com.furniture.sql.Good;
import com.google.gson.Gson;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Bob on 2016/3/29.
 */
public class ListToJson {

    /**
     *             任意对象
     * @return java.lang.String
     */
    public static String listToJson(List<Good> list) {
        Gson gson = new Gson();
        String json = gson.toJson(list);
        Log.i("listGood",json==null?"null": json);
        return json;
    }

    public static String goodToList(Good good){
        List<Good> goodList = new ArrayList<Good>();
        goodList.add(good);
        listToJson(goodList);
        return null;
    }
}
